package zhoug.common.permission;

import android.content.Context;

import zhoug.common.view.dialog.ZButtonDialog;

import androidx.annotation.NonNull;

/**
 * @Author 35574
 * @Date 2021/6/7
 * @Description
 */
class PermissionDescriptionDialog implements IPermissionDescriptionDialog {

    public void show(Context context, String description, @NonNull Callback callback) {
        ZButtonDialog buttonDialog = new ZButtonDialog(context);
        buttonDialog.setTitle("授权");
        buttonDialog.setMessage(description);
        buttonDialog.setPositiveListener("去授权", v -> {
            buttonDialog.dismiss();
            callback.onConfirm();
        });
        buttonDialog.setNegativeListener("拒绝", v -> {
            buttonDialog.dismiss();
            callback.onRefuse();
        });
        buttonDialog.setCancelable(false);
        buttonDialog.show();
    }


}
